<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition   xmlns="http://www.w3.org/1999/xhtml"
			      xmlns:h="http://java.sun.com/jsf/html"
				  xmlns:p="http://primefaces.org/ui"
			      xmlns:f="http://java.sun.com/jsf/core"
			      xmlns:ui="http://java.sun.com/jsf/facelets"
			      >

<p:panel header="Search Options" toggleable="true" toggleOrientation="vertical" collapsed="false">  
   		<p:panelGrid columns="6" style="margin-bottom:10px;font-size:14px;" cellpadding="5">  
  		<f:facet name="header">  
        
    	</f:facet>  
  
  		<h:outputText value="Country: " /> 
        <p:selectManyMenu id="controlcountries" value="#{controlDistInfoManagedBean.countries}" style="height:120px">    
            <f:selectItems value="#{servicesManagedBean.allCountriesList}" />  
            <p:ajax update="CDDistributors" listener="#{controlDistInfoManagedBean.updateDistributorsList}"/> 
        </p:selectManyMenu>   
        
        
        <h:outputText value="Distributor: " />   
        <p:selectManyMenu id="CDDistributors" value="#{controlDistInfoManagedBean.distributors}" style="height:120px" required="true">    
         <f:selectItems value="#{controlDistInfoManagedBean.distList}" />
        </p:selectManyMenu> 
           
          <h:outputText value="Interface: " />   
        <p:selectManyMenu id="CDInterfaces" value="#{controlDistInfoManagedBean.interfcaes}" style="height:120px;width:150px">    
         <f:selectItems value="#{servicesManagedBean.interfacesList}" />
        </p:selectManyMenu> 
        
        <h:outputText value="From: " />  
 		<p:calendar id="controlfrom"  styleClass="calendarFilter" pattern="dd-MMM-yy" value="#{controlDistInfoManagedBean.from}" showOn="button" size="20" required="true" requiredMessage="Required">
        </p:calendar>
        
        <h:outputText value="To: " />
        <p:calendar id="controlto"  styleClass="calendarFilter" pattern="dd-MMM-yy" value="#{controlDistInfoManagedBean.to}" showOn="button" size="20" required="true" requiredMessage="Required">
        </p:calendar>
        
        <p:commandButton value="GO" update="controldisttableP @form" action="#{controlDistInfoManagedBean.updateList}" global="true" />

        <h:commandLink rendered="#{controlDistInfoManagedBean.methodCalled}">
					<p:graphicImage value="NWDSAKMS-excel-logo.png" width="30"
						height="30" title="Export to Excel" style="border:0" />
					<p:dataExporter type="xls" target="controldisttable"
						fileName="Control_Table_#{servicesManagedBean.dateNow}" />
		</h:commandLink>
		</p:panelGrid>

	</p:panel>

<p:panel id="controldisttableP">
	<p:dataTable id="controldisttable" rendered="#{controlDistInfoManagedBean.methodCalled}" 
 				 style="margin-top:5px" var="cdinfo" 
                 value="#{controlDistInfoManagedBean.clist}"  
                 scrollRows="20" rows="20"  
                 liveScroll="true" 
                 lazy="true"
                 paginator="true"
                 sortBy="#{cdinfo.createddate.day}"                 
                 >
              
  
        <f:facet name="header" >  
  <p:outputPanel style="float: left">       
    <h:outputText value="Control Dist. Info " />
  </p:outputPanel>           
        </f:facet>
        <p:column width="120">
		        <f:facet name="header" >  
	    			Distributor
		        </f:facet>  
		             <h:outputText value="#{cdinfo.distributorid} " /> 
        </p:column>
        
        <p:column width="100">
		        <f:facet name="header" >  
	    			Country
		        </f:facet>  
		             <h:outputText value="#{cdinfo.country} " /> 
        </p:column>  
        
          
        <p:column width="200">
	        <f:facet name="header" >  
	                    Created Timestamp
	            </f:facet>  
	             
	             <h:outputText value="#{cdinfo.createdtimestamp}" /> 
        </p:column>  
        
              <p:column width="100">
        <f:facet name="header" >  
                    Guino
            </f:facet>  
             
             <h:outputText value="#{cdinfo.guino}" /> 
        </p:column> 
        
  
        <p:column width="195">  
            <f:facet name="header" >  
                    Interfacenme
            </f:facet>  
            
            <h:outputText value="#{cdinfo.interfacenme}" /> 
        </p:column>  
  
             <p:column width="150">
        <f:facet name="header" >  
                    Records Count
            </f:facet>  
             
             <h:outputText value="#{cdinfo.recordscount}" /> 
        </p:column> 
        
        
        <p:column width="70">
        <f:facet name="header" >  
                    Status
            </f:facet>  
           
             <h:outputText value="#{cdinfo.status}" /> 
        </p:column> 
        
     <p:summaryRow>
		<p:column colspan="7" >    
            </p:column> 
        </p:summaryRow> 

   
    </p:dataTable>
    </p:panel>
</ui:composition>